"use client";

import { useSearchParams } from "next/navigation";

export default function LoginErrorPage() {
  const searchParams = useSearchParams();
  const error = searchParams.get("error");

  return (
    <div>
      <h1>Login Failed</h1>
      <p>
        {error === "CredentialsSignin"
          ? "Invalid email or password."
          : "An unknown error occurred."}
      </p>
      <a href="/login">Try Again</a>
    </div>
  );
}
